package com.cci.kangdao.wechatOrder.service;

import com.cci.kangdao.dao.model.WorkOrderT;
import com.cci.kangdao.wechatOrder.model.WeChatSmsLinkTokenT;

/**
 * @description: 微信短信通知服务
 * @author: zyf
 * @create: 2021-03-28
 */
public interface IWeChatNoticeService {

    void sendSmsNotice(WorkOrderT workOrderT,Long companyId,String message,String token) throws Exception;

    /**
     * 生成短信内容
     * @param workOrderT
     * @return
     * @throws Exception
     */
    String getSmsLinkMessageByOrder(WorkOrderT workOrderT,String token)throws Exception;

    /**
     *
     * @param crmNo
     * @return
     * @throws Exception
     */
    String getSmsLinkMessageByCrm(String crmNo,String token);

    /**
     *
     * @param token
     * @return
     * @throws Exception
     */
    WeChatSmsLinkTokenT getSmsLinkTokenByToken(String token) throws Exception;

    /**
     *
     * @param id
     * @return
     * @throws Exception
     */
    WeChatSmsLinkTokenT getSmsLinkTokenById(String id) throws Exception;

    /**
     *
     * @param orderId
     * @param crmOrderNo
     * @param companyId
     * @param token
     * @param expireTime
     * @param type
     * @return
     * @throws Exception
     */
    void saveSmsLinkToken(Long id,Long orderId,String crmOrderNo,Long companyId,String token,String expireTime,Integer type)throws Exception;

    /**
     * 更新数据标记
     * @param token
     */
    void updateSmsLinkTokenFlagByToken(String token)throws Exception;


    void updateTokenStatusByBindId(Long id,Integer flag);

    /**
     *
     * @param id
     * @param token
     * @param status
     * @return
     */
    WeChatSmsLinkTokenT selectTokenByTokenAndStatus(Long id,String token,Integer status);

    /**
     * 根据手机号发送短信
     *
     * @param phone
     * @param message
     * @param token
     * @return
     */
    void sendSmsNoticeNoWorkOrder(String phone, String message, String token) throws Exception;
}
